<template>
	<view>
		<view class="popup-content" v-if="showMask">
			<view class="pop-header">
				提示 <image src="@/static/testvalid/icon-close.png" class="close" @click="hide"></image>
			</view>
			<view class="pop-body">
				首次进入考试前请先完成实名认证
			</view>
			<view class="pop-footer">
				<text @click="toAuthorize" class="authorized ">
					立即认证
				</text>
				<text @click="hide" class="cancle">
					取消
				</text>
			</view>
		</view>
		<view class="mask" v-if="showMask">
		</view>
	</view>
</template>

<script>
	export default {
		name: "confirm-popover",
		data() {
			return {
				showMask: false
			};
		},
		methods: {
			toAuthorize() {
				// 认证成功后，关闭认证弹框，保存状态
				if (true) {
					uni.setStorageSync('isfirst', false)
					this.showMask = false
				}
				uni.navigateTo({
					url: '/pages/real-name-authentication/real-name-authentication'
				})
			},
			open() {
				this.showMask = true
			},
			hide() {
				this.showMask = false
			},
		},
	}
</script>

<style lang="scss" scoped>
	.popup-style {
		z-index: 2001;
	}

	.mask {
		position: fixed;
		top: 0;
		left: 0;
		right: 0;
		bottom: 0;
		background-color: #000;
		z-index: 111;
		opacity: 0.5;
	}

	.popup-content {
		width: 690rpx;
		height: 416rpx;
		background: #FFFFFF;
		border-radius: 8rpx !important;
		overflow: hidden;
		display: flex;
		flex-direction: column;
		position: absolute;
		left: 50%;
		top: 50%;
		transform: translate(-50%, -50%);
		z-index: 222;
	}

	.pop-header {
		width: 690rpx;
		height: 100rpx;
		line-height: 100rpx;
		padding: 0 40rpx;
		background: #FFFFFF;
		font-size: 36rpx;
		font-family: SourceHanSansCN-Bold, SourceHanSansCN;
		font-weight: bold;
		color: #333333;
		display: flex;
		justify-content: space-between;
		align-items: center;
		border-bottom: 2rpx solid #f1f1f5;

		.close {
			width: 32rpx;
			height: 32rpx;
		}
	}

	.pop-body {
		flex: 1;
		display: flex;
		align-items: center;
		justify-content: center;
		font-size: 28rpx;
		font-family: SourceHanSansCN-Normal, SourceHanSansCN;
		font-weight: 400;
		color: #333333;
		border-bottom: 2rpx solid #f1f1f5;
	}

	.pop-footer {
		height: 120rpx;
		display: flex;
		align-items: center;
		justify-content: center;

		text {
			width: 180rpx;
			height: 80rpx;
			text-align: center;
			line-height: 80rpx;
			background: #047BFC;
			border-radius: 16rpx;
			font-size: 32rpx;
			font-family: SourceHanSansCN-Medium, SourceHanSansCN;
			font-weight: 500;
			color: #FFFFFF;
			margin: 0 20rpx;
		}

		.cancle {
			background: #FFFFFF;
			border: 2rpx solid #047BFC;
			color: #047BFC;
		}
	}
</style>
